import os
import json

def init():
    info = {}
    os.environ["BASE_URL"] = "https://ark.cn-beijing.volces.com/api/v3"
    if not os.path.exists(os.path.join("conf", "config.json")):
        info["API_KEY"] = input("请输入API_KEY：")
        info["VISION"] = input("请输入视觉模型ID：")
        os.makedirs("conf", exist_ok=True)
        json.dump(info, open(os.path.join("conf", "config.json"), "w"), indent=4)
    else:
        info = json.load(open(os.path.join("conf", "config.json"), "r"))
    os.environ["API_KEY"] = info["API_KEY"]
    os.environ["VISION"] = info["VISION"]